laravel where creation is today carbon

44

laravel where creation is today carbon -

    $posts = Post::whereDate('created_at', Carbon::today())->get();

where('created_at', '=', date('Y-m-d')); -

$q->whereDay('created_at', '=', date('d'));
$q->whereMonth('created_at', '=', date('m'));
$q->whereYear('created_at', '=', date('Y'));

where('created_at', '=', date('Y-m-d')); -

$q->where('created_at', '>=', date('Y-m-d').' 00:00:00'));

Comments

Submit
0 Comments